feat: add code samples for actor collection #1318
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here are the first two code samples for the API docs. These are for the JS client and are a tentative proposal. When we've agreed on how they should look, I'll also add the ones for the Python client.
Note: The Palo Alto plugin currently doesn't support TypeScript and there's no straightforward way to add multiple custom code samples for the same language (I thought we could have JS and TS client samples under the JavaScript bit).
I have created an issue asking about this on the plugin's repo: PaloAltoNetworks/docusaurus-openapi-docs#1035
Note 2: For the POST request, as mentioned by @netmilk , it would be nice to have the request body present, but that would be complicated, since the schema isn't available in the examples, and would make the testing harder. I think it's not so bad, though, since the request body is shown right under the code example, so it's quite easy to find.
So, on the new docs it will look like this:

And in the old/current docs like this: (I had to fix the background color)
